--Prop Item
--By Kylegar


ENT.Type = "anim"
ENT.Base 			= "base_anim"

ENT.PrintName		= "Item"
ENT.Author			= "Kylegar"
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= ""

ENT.Spawnable			= true
ENT.AdminSpawnable		= true

if (SERVER) then
	AddCSLuaFile( "shared.lua" )

	local MODEL = Model( "models/props/de_prodigy/ammo_can_02.mdl" )
	ENT.Item = "Deagle"
	/*---------------------------------------------------------
	   Name: Initialize
	---------------------------------------------------------*/
	function ENT:Initialize()

		self.Entity:SetModel( MODEL )
		self.Entity:PhysicsInit( SOLID_VPHYSICS )
		self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
		self.Entity:SetSolid( SOLID_VPHYSICS )
		
		local phys = self.Entity:GetPhysicsObject()
		
		if (phys:IsValid()) then
			phys:Wake()
		end
		
		
		
	end
	
	function ENT:SpawnFunction( ply, tr )
		if ( !tr.Hit ) then return end
		
		local SpawnPos = tr.HitPos + tr.HitNormal * 16
		SpawnPos.z = SpawnPos.z + 16
		
		local ent = ents.Create( "sent_item" )
		ent:SetModel(MODEL)
		ent:SetPos( SpawnPos )
		ent:Spawn()
		ent:Activate()
		
		return ent
	end
	
	function ENT:Setup(model,item)
		self.Entity:SetModel(model)
		self.Item = item
	end
	
	function ENT:SetItem(item)
		self.Item=item
	end
	
	
	function ENT:OnTakeDamage( dmginfo )
		self.Entity:TakePhysicsDamage( dmginfo )
	end
	
	function ENT:Use( activator, caller )
		
			
	end
	
end
if (CLIENT) then

	ENT.RenderGroup 	= RENDERGROUP_BOTH

	function ENT:Initialize()
		
	end
	
	ENT.Overlay = "Error!"
	function ENT:GetOverlayText()

		return self.Overlay
		
	end

	function ENT:SetOverlayText(text)
		self.Overlay = text or ""
	end
	
end
